// 获取mongoose驱动
const mongoose = require('mongoose');

// order 集合数据数据结构
const orderSchema = new mongoose.Schema({
  orderTime: String,
  totalPrice: Number,
  userId: { type: "ObjectId", ref: "users" },
  searchName: String,
  commodities: Array,
  isPaySuccess: Number,
  isAffirmReceive: Number,
  isDisplay: Number,
});

// 创建model
mongoose.model("order", orderSchema, "order");